import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:yt_devops/components/app_bar/app_bar_widget.dart';
import 'package:yt_devops/components/gaps.dart';
import 'package:yt_devops/components/yt_text_style.dart';
import 'package:yt_devops/resources/str_res_keys.dart';
import 'package:yt_devops/styles/styles.dart';
import 'device_scan_fail_controller.dart';

class DeviceScanFailPage extends GetView<DeviceScanFailController> {
  const DeviceScanFailPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBarWidget.withRightActions(ResKey.addNewDevice.tr),
      body: GetBuilder<DeviceScanFailController>(
        builder: (controller) => Container(
          color: Colors.white,
          width: ScreenUtil().screenWidth,
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Container(
                margin: const EdgeInsets.only(top: 159),
                alignment: Alignment.center,
                child: Text(
                    controller.tip,
                    style: ytTextStyle(fontSize: 16,fontWeight: FontWeight.w500)
                ),
              ),
              GestureDetector(
                onTap: (){
                  controller.manualAddDevice();
                },
                child: Container(
                  margin: const EdgeInsets.only(top: 16),
                  alignment: Alignment.center,
                  width:ScreenUtil().screenWidth,
                  child: Text(
                      ResKey.manualAddition.tr,
                      style: ytTextStyle(fontSize: 14,fontWeight: FontWeight.w500,color: Colour.primaryColor)
                  ),
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
